package com.bkgy.controller.allprocess.controller;

import com.bkgy.controller.allprocess.dto.AllpricessIndexProductReasonResponse;
import com.bkgy.controller.allprocess.dto.AllpricessIndexReasonRequst;
import com.bkgy.controller.allprocess.service.AllProcessIndexProductReasonService;
import com.bkgy.sys.common.entity.ResultData;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@RestController
@RequestMapping("/allprocess")
public class AllprocessIndexProductReasonController {

    @Autowired
    private AllProcessIndexProductReasonService productReasion;

    @Operation(summary = "全流程成材率模型首页 产品品种和异常原因", description = "全流程成材率模型首页 产品品种和异常原因")
    @PostMapping("/productReason")
    public ResultData<AllpricessIndexProductReasonResponse> productReason (@RequestBody @Valid AllpricessIndexReasonRequst request)
    {
        return productReasion.productReason(request);
    }

}
